require.config({
	baseUrl:'../js/img_cut',
	paths:{
		'jquery':'jquery',
		'iscroll': 'iscroll-zoom-min',
        'hammerjs': 'hammer.min',
        'lrz': 'lrz.all.bundle',
        'PhotoClip': 'PhotoClip'
	},
	shim: {
		'iscroll': {
            exports: 'IScroll'
		},
        'jquery':{
        	exports: '$'
        }
		
	}
})

require(['jquery','PhotoClip'],function($,PhotoClip){
	var file_imgurl
	var pc=new PhotoClip('#clipArea',{
		size:[300,300],
		file: '#file',
		view: "#view",
		ok: "#clipBtn",
		uploadurl:'http://192.168.1.66:8080/api/file/saveface',//本地上传地址
		logox_id:'#logox',//点击显示头像裁剪区域
		/*loadStart: function() {
			console.log("照片读取中");
		},
		loadComplete: function() {
			console.log("照片读取完成");
		},*/
		//截取完成
		done: function(dataURL) {
			//console.log(dataURL);//图片路径
			console.log('fixing ')
		}
		
	})
	
	
	//点击头像打开选择图片截取
	$("#logox").click(function(){
		$(".htmleaf-container").show();
		
	}) 
	//取消按钮
	$('.cancel_img').click(function(){
		$(".htmleaf-container").hide();
		$('.photo-clip-moveLayer img').attr('src','')
	})
	//截取按钮
	$("#clipBtn").click(function(){
		
	})
	
	
})

/*不是require引入
 require.config({
  baseUrl:'../../static/js/img_cut',
  paths: {
    test: 'test'
  },
  shim: {
	  test: { exports: 'test' }
	  }
});
 
require(['test'], function(test) {
	test()
});*/